<script type="text/javascript">
  // 定义一些公共的属性和方法

  //后台服务地址
  //console.log(localStorage.getItem("ccc"))
  let m_ip = "127.0.0.1"
  let m_port = "8081"
  if (localStorage.getItem("m_ip") != null) {
    m_ip = localStorage.getItem("m_ip")
  }
  if (localStorage.getItem("m_port") != null) {
    m_port = localStorage.getItem("m_port");
  }
  const IP = "http://" + m_ip + ":";
  let ipport = m_ip + ":" + m_port;
  const httpUrl = "http://" + ipport + "/"; //192.168.31.31   


  //提取数组id转化
  function deveridarrry(arr) {
    if (typeof arr != "undefined" && arr != null) {
      let array = [];
      for (var i = 0; i < arr.length; i++) {
        array.push(parseInt(arr[i].id));
      }
      return JSON.stringify(array);
    } else {
      return [];
    }
  }

  export default {
    httpUrl,
    deveridarrry
  };

</script>
